perm filename INIT.SAI[HAL,HE] blob
sn#122330 filedate 1974-09-30 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00007 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 ! (Common macros)
C00003 00003 ! Variables for input/output
C00004 00004 ! Variables for lexical analysis
C00008 00005 ! Variables for the symbol tables routines
C00009 00006
C00010 00007 ! SEPARATELY COMPILED PROCEDURES
C00012 ENDMK
C⊗;
! (Common macros);
REQUIRE "MACMAC[CSP,SYS]"source_file;
! (Macros for i/o and scanning);
REQUIRE "IOREL[HAL,HE]" load_module;
! (I/o and scanning routines);
! The hash function;
! Variables for input/output;
INTERNAL integer progchan, pcount, pbrchar, peof;
! The macro space;
INTERNAL string array macrospace[0:200];
INTERNAL integer array inputchannels[0:40];
INTERNAL integer numchan;
INTERNAL string array macstack [0:40];
INTERNAL string currentmacro, currmac; INTERNAL boolean readfrommacro;
INTERNAL integer evalswitch;
INTERNAL boolean debugmode;
! Variables for lexical analysis;
INTERNAL integer token; INTERNAL string symb;
INTERNAL integer tidentifier, tdelimiter, tdoubledelim;
INTERNAL string array lastokens[0:15]; INTERNAL integer currtok;
INTERNAL integer macronum,typnum,resnum;
INTERNAL boolean dontinsert;
define mintyp = ⊂ -35⊃;
define defnewtype(typnam) = ⊂def typnam = ⊂mintyp⊃; redefine mintyp = ⊂mintyp - 1⊃;⊃;
! Each line below corresponds to a line in the ASCII code table;
PRELOAD_WITH
endfile, [3]illegal, [2]delimiter, [2] illegal,
illegal, [2]separator, illegal, [2]separator, [2]illegal,
macrobodystart, macrobodyend, [6]illegal,
letter, [2]illegal, [5]delimiter,
separator, letter, quote,illegal, macrocall, endmacro, delimiter, octal,
[6]delimiter, decimaldot, delimiter,
['10]number,
[2]number, [5]delimiter, illegal,
illegal, [7]letter,
['10]letter,
['10]letter,
[3]letter, delimiter, illegal, delimiter, illegal, delimiter,
donteval, [7]letter,
['10]letter,
['10]letter,
[3]letter, ccomment, [2]illegal, endcomment, illegal;
INTERNAL INTEGER ARRAY charclass[0:'177];
internal boolean array doubdel[0:'177];
! The queer names below ("tidentifier", etc.) are macros which
stand for tokens, and are defined in MACMAC.SAI ;
PRELOAD_WITH
[26] "UNKNOWN",
"TLABEL","TDOUBLEDELIM","TCLASS","TTYPE",
"TVECTOR","TPLANE","TTRANS","TFRAME","TCOMPLEX","TPROCEDURE","TSTRINGVAR",
"TREALVAR","TINTVAR","TNONDECLARED",
[7] "UNKNOWN", "TMACRO",
"TENDCOMMENT","TDEFINE","TCOMMENT",
[3] "UNKNOWN", "TENDFILE",
"TMACBODYSTART","TSTRING","TREAL","TINTEGER","TNOTHING", "TSANSTYPE";
INTERNAL string array tokename[-60:0]; ! For debugging purposes;
! To add types to the above list:
! define newtype(typnam) = ⊂ redefine typnam = addtype("typnam") ⊃;
! The following array contains the reserved words used by the program;
PRELOAD_WITH
"COMMENT","DEFINE","REQUIRE",
[10] "UNKNOWN",
"ILLEGAL","LETTER","DELIMITER","SEPARATOR","DONTEVAL","OCTAL","DOUBLE_DELIMITER",[3]"UNKNOWN",
[10]"UNKNOWN",
"COMMENT_DELIMITERS","MACROBODY_DELIMITERS","MACRO_DELIMITERS",[7]"UNKNOWN",
[10]"UNKNOWN",
"SOURCE_FILE","NEW_TYPE","DEBUG_MODE",[7]"UNKNOWN",
[10]"UNKNOWN";
INTERNAL string array reservname[128:200];
! Variables for the symbol tables routines;
INTERNAL record_class entri(integer rtype, val, blocklevel; string itemvar name;
record_pointer(entri) link;
record_pointer(ANY_CLASS) semantics);
INTERNAL record_pointer (ENTRI) array bucket [0:63];
INTERNAL record_pointer(ENTRI) old_id, new_id;
EXTERNAL integer blocklevell;
! If the symbol table routines are not wanted (in which case
COMMENT, DEFINE, REQUIRE and macros will not be recognized), replace
"SEAR" by "NOSEAR" in the following line;
require "SEAR[CSP,SYS]" load_module;
! SEPARATELY COMPILED PROCEDURES;
EXTERNAL SIMPLE procedure lexan;
EXTERNAL SIMPLE procedure breaktables;
EXTERNAL SIMPLE procedure initscan(VALUE string filename; VALUE integer inbufnum; VALUE boolean instypes);
EXTERNAL SIMPLE integer procedure newres (VALUE string resword;VALUE boolean searched);
EXTERNAL SIMPLE integer procedure newtype(VALUE string typename; VALUE boolean searched);
EXTERNAL SIMPLE procedure error(VALUE string mess);
EXTERNAL boolean PROCEDURE searchinsert(VALUE string id);
EXTERNAL SIMPLE boolean procedure please_answer(VALUE string question);
EXTERNAL SIMPLE procedure open_lookup_enter(REFERENCE string file; REFERENCE integer channel;
VALUE string device;
VALUE integer mode, inbufnum, outbufnum;
REFERENCE integer count, brchar, eof);
EXTERNAL SIMPLE procedure printable(VALUE integer typrint);
EXTERNAL SIMPLE PROCEDURE check_extension(REFERENCE string filename;
VALUE string extension);
EXTERNAL PROCEDURE skip_directory_page;